#include"../source/server.hpp"
//错误请求测试

int main()
{
    Socket cli_sock;
    bool ret = cli_sock.CreateClient(8085,"127.0.0.1");
    if(ret == false)
    {
        ERR_LOG("create newlink error");
        abort();
    }
    cout << "Create Client Success"<< endl;
    string str = "GET /hell0 HTTP/1.1\r\nConnection:keep-alive\r\nContent-Length:100\r\n\r\nbitjiuyeke";
    // assert(cli_sock.Send(str.c_str(),str.size())!=-1);
    // char buf[1024] = {0};
    // assert(cli_sock.Recv(buf,1023));
    // DBG_LOG("[%s]",buf);
    while(1)
    {
        assert(cli_sock.Send(str.c_str(),str.size())!=-1);
        assert(cli_sock.Send(str.c_str(),str.size())!=-1);
        assert(cli_sock.Send(str.c_str(),str.size())!=-1);
        char buf[1024] = {0};
        assert(cli_sock.Recv(buf,1023));
        DBG_LOG("[%s]",buf);
        sleep(3);
    }
    cli_sock.Close();
}